package com.deyuanyun.pic.ae.controller.dto;

import com.deyuanyun.pic.ae.domain.*;
import com.deyuanyun.pic.settings.support.cache.SessionCacheSupport;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 第三方管道信息 审核对象 数据传输对象
 */
public class AEBaseAudit {
    /**
     * 主键
     */
    private String id;

    /**
     * 数据状态
     */
    private String dataStated;

    /**
     * 审核意见
     */
    private String auditContent;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDataStated() {
        return dataStated;
    }

    public void setDataStated(String dataStated) {
        this.dataStated = dataStated;
    }

    public String getAuditContent() {
        return auditContent;
    }

    public void setAuditContent(String auditContent) {
        this.auditContent = auditContent;
    }

    String realName = SessionCacheSupport.getSessionVO()!=null && SessionCacheSupport.getSessionVO().getUserDetailInfo() != null ? SessionCacheSupport.getSessionVO().getUserDetailInfo().getRealName() : null;

    /**
     * 转换为 第三方管道和设施
     * @return
     */
    public AEPipeline toAEPipeline() {
        AEPipeline aePipeline = new AEPipeline();
        aePipeline.setId(this.id);
        aePipeline.setUpdateDate(new Date());
        aePipeline.setUpdateRemark("审核修改");
        aePipeline.setUpdateUser(realName);
        aePipeline.setAuditContent(this.auditContent);
        aePipeline.setAuditDate(new Date());
        aePipeline.setDataStated(this.dataStated);
        return aePipeline;
    }

    /**
     * 转换为 交通设施信息
     * @return
     */
    public TrafficFacilities toTrafficFacilities() {
        TrafficFacilities trafficFacilities = new TrafficFacilities();
        trafficFacilities.setId(this.id);
        trafficFacilities.setUpdateDate(new Date());
        trafficFacilities.setUpdateRemark("审核修改");
        trafficFacilities.setUpdateUser(realName);
        trafficFacilities.setAuditContent(this.auditContent);
        trafficFacilities.setAuditDate(new Date());
        trafficFacilities.setDataStated(this.dataStated);
        return trafficFacilities;
    }

    /**
     * 转换为 沿线地质灾害 信息
     *
     * @return
     */
    public GeologicHazard toGeologicHazard() {
        GeologicHazard geologicHazard = new GeologicHazard();
        geologicHazard.setId(this.id);
        geologicHazard.setUpdateDate(new Date());
        geologicHazard.setUpdateRemark("审核修改");
        geologicHazard.setUpdateUser(realName);
//        geologicHazard.setAuditContent(this.auditContent);
//        geologicHazard.setAuditDate(new Date());
        geologicHazard.setDataStated(this.dataStated);
        return geologicHazard;
    }


    /**
     * 转换为 沿线特定场所
     * @return
     */
    public SpecificPlace toSpecificPlace() {
        SpecificPlace specificPlace = new SpecificPlace();
        specificPlace.setId(this.id);
        specificPlace.setUpdateDate(new Date());
        specificPlace.setUpdateRemark("审核修改");
        specificPlace.setUpdateUser(realName);
        specificPlace.setAuditContent(this.auditContent);
        specificPlace.setAuditDate(new Date());
        specificPlace.setDataStated(this.dataStated);
        return specificPlace;
    }

    /**
     * 转换为 管道沿线地下排水排污设施信息
     *
     * @return
     */
    public Sewer toSewer() {
        Sewer sewer = new Sewer();
        sewer.setId(this.id);
        sewer.setUpdateDate(new Date());
        sewer.setUpdateRemark("审核修改");
        sewer.setUpdateUser(realName);
        sewer.setAuditContent(this.auditContent);
        sewer.setAuditDate(new Date());
        sewer.setDataStated(this.dataStated);
        return sewer;
    }

    /**
     * 转换为 管道沿线应急资源
     *
     * @return
     */
    public EmergencyResource toEmergencyResource() {
        EmergencyResource emergencyResource = new EmergencyResource();
        emergencyResource.setId(this.id);
        emergencyResource.setUpdateDate(new Date());
        emergencyResource.setUpdateRemark("审核修改");
        emergencyResource.setUpdateUser(realName);
        emergencyResource.setAuditContent(this.auditContent);
        emergencyResource.setAuditDate(new Date());
        emergencyResource.setDataStated(this.dataStated);
        return emergencyResource;
    }

    /**
     * 转换为 难以维修接近
     *
     * @return
     */
    public DifficultyRepair toDifficultyRepair() {
        DifficultyRepair difficultyRepair = new DifficultyRepair();
        difficultyRepair.setId(this.id);
        difficultyRepair.setUpdateDate(new Date());
        difficultyRepair.setUpdateRemark("审核修改");
        difficultyRepair.setUpdateUser(realName);
        difficultyRepair.setAuditContent(this.auditContent);
        difficultyRepair.setAuditDate(new Date());
        difficultyRepair.setDataStated(this.dataStated);
        return difficultyRepair;
    }

    /**
     * 转换为 管道占压物
     *
     * @return
     */
    public PressObject toPressObject() {
        PressObject pressObject = new PressObject();
        pressObject.setId(this.id);
        pressObject.setUpdateDate(new Date());
        pressObject.setUpdateRemark("审核修改");
        pressObject.setUpdateUser(realName);
        pressObject.setAuditContent(this.auditContent);
        pressObject.setAuditDate(new Date());
        pressObject.setDataStated(this.dataStated);
        return pressObject;
    }
}